// Declare loop control variable inside for.
class ForVar {
    public static void main(String args[]) {
        int sum = 0;
        int fact = 1;

        for(int i = 1; i <= 5; i++) {
            sum += i; // i is known throughout the loop.
            fact *= i;
        }

        // But i is not known here.

        System.out.println("Sum is " + sum);
        System.out.println("Factorial is " + fact);
    }
}


